package com.yjyw.tiexie.activity.login

import android.content.Intent
import android.content.SharedPreferences
import android.graphics.Color
import android.os.Build
import android.os.Bundle
import android.text.SpannableStringBuilder
import android.text.Spanned
import android.text.TextPaint
import android.text.method.LinkMovementMethod
import android.text.style.ClickableSpan
import android.view.View
import android.view.Window
import android.view.WindowManager
import android.widget.TextView
import androidx.annotation.RequiresApi
import androidx.appcompat.app.AppCompatActivity
import com.yjyw.tiexie.BuildConfig
import com.yjyw.tiexie.R
import com.yjyw.tiexie.common.net.ThreadPoolManger
import com.yjyw.tiexie.util.FastCilckOneUtil
import com.yjyw.tiexie.util.HandlerTip
import com.yjyw.tiexie.util.SharedPreferencesUtils
import com.yjyw.tiexie.util.StringUtil
import com.yjyw.tiexie.widget.CustomDialog
import com.umeng.analytics.MobclickAgent
import com.umeng.commonsdk.UMConfigure
import com.umeng.socialize.PlatformConfig
import com.umeng.socialize.UMShareAPI


/**
 * Created by SmallYou on 2019/1/4 0004.
 * DESC:TODO()
 */
class StartPageActivity : AppCompatActivity(), HandlerTip.HandlerCallback {

    override fun postDelayed() {
        val sign = SharedPreferencesUtils.getParam(this, "userSign", "").toString() + ""


        val intent = Intent()
        intent.setClass(this, LoginActivity::class.java)
        startActivity(intent)
        finish()
    }


    @RequiresApi(Build.VERSION_CODES.P)
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        //无title
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        val lp = window.attributes
        if (Build.VERSION.SDK_INT >= 28) {
            lp.layoutInDisplayCutoutMode =
                WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_DEFAULT;
            window.attributes = lp
        }


        val sp = getSharedPreferences("isPlace", 0)
        val place = sp.getString("agree", "")
//        if ("" == place) {
//            //第一次用app提醒查看用户协议
//            showPop();
//        } else {
        HandlerTip.getInstance().postDelayed(2000, this)
//        }

    }


    override fun onDestroy() {
        super.onDestroy()
        ThreadPoolManger.getInstance().removeTaskAll()
    }

    public override fun onResume() {
        super.onResume()
    }

    public override fun onPause() {
        super.onPause()
    }
}
